# Contributor: Eivind Uggedal <eu@eju.no>
# Maintainer: Laurent Bercot <ska-devel@skarnet.org>
pkgname=s6-rc
pkgver=0.5.5.0
pkgrel=1
pkgdesc="Service manager for s6-based systems"
url=https://skarnet.org/software/s6-rc/
arch="all"
license="ISC"
options="!check"
_skalibs_version=2.14.3
_execline_version=2.9.6
_s6_version=2.13.1
makedepends="skalibs-dev>=$_skalibs_version execline-dev>=$_execline_version s6-dev>=$_s6_version"
subpackages="$pkgname-static $pkgname-libs $pkgname-dev $pkgname-doc"
source="https://skarnet.org/software/s6-rc/s6-rc-$pkgver.tar.gz	s6-rc.pc.in"

build() {
	./configure \
		--enable-shared \
		--prefix=/usr \
		--disable-allstatic \
		--libexecdir="/usr/lib/$pkgname"
	make
}

package() {
	make DESTDIR="$pkgdir" install
	sed -e "s/@@VERSION@@/$pkgver/g; s/@@SKALIBS_VERSION@@/${_skalibs_version}/g; s/@@S6_VERSION@@/${_s6_version}/g;" "$srcdir/$pkgname.pc.in" > "$srcdir/$pkgname.pc"
	install -D -m 0644 "$srcdir/$pkgname.pc" "$pkgdir/usr/lib/pkgconfig/$pkgname.pc"
	mkdir -p "$pkgdir/usr/share/doc"
	cp -a "$builddir/doc" "$pkgdir/usr/share/doc/$pkgname"
}

sha512sums="
8769c71eaf1416fb1d2040865585e0c3c7abb0c9732313d3534f82be8f50417500796cda41a434e8a521bff77960ba23009e51080892700a158ae61537303081  s6-rc-0.5.5.0.tar.gz
bdd792c41834071ded3ace50848bff5a9f5e2b1cad50d63aae520c7e66634a793d748910e67d8d1ac8f2f8e7e86ff71e36ece14ed9b1eca376c8d59bf056638b  s6-rc.pc.in
"
